'  ====================================================================
'  |                                                                  |
'  | SQLitening Include                                               |
'  |                                                                  |
'  ====================================================================
'   This include file is intended to be used by PowerBASIC programs 
'   that use the SQLitening.Dll (also any other language that fully 
'   supports OLE string parameter passing). See SQLitening.Txt or 
'   SQLitening.Chm for information on each command. 
' 
'  ====================================================================
'  PUBLIC DOMAIN SOFTWARE
'  The author or authors of this code dedicate any and all 
'  copyright interest in this code to the public domain. 
'  Anyone is free to copy, modify, publish, use, compile, 
'  sell, or distribute the original code, either in source 
'  code form or as a compiled binary, for any purpose, 
'  commercial or non-commercial, and by any means.
'  Fred Meier - July 2010
' 
'  ====================================================================

'============================<[ Equates ]>=============================
' ==========>>> SQLitening return codes
%SQLitening_NoOpenDatabase          =  -7
%SQLitening_AccessDenied            =  -8
%SQLitening_FileDoesNotExist        =  -9
%SQLitening_FileOpenGetPutError     = -10
%SQLitening_LockTimeout             = -11
%SQLitening_NochangedRows           = -12
%SQLitening_InvalidColumnNameNumber = -13
%SQLitening_InvalidSetNumber        = -14   
%SQLitening_AttachIsInvalid         = -15
%SQLitening_CanNotConnect           = -16
%SQLitening_InvalidKeyOrNotFound    = -17
%SQLitening_SendOrReceiveError      = -18
%SQLitening_InvalidStringOrRequest  = -19
%SQLitening_ErrorAtServer           = -20

' ==========>>> SQLite return codes
%SQLite_OK        = 0         'Successful result
%SQLite_Busy      = 5         'Database is locked
%SQLite_Dups      = 19        'Constraint violation.  Normally caused by 
                              'trying to add a non unique key to an index 
                              'during an Insert or Update.

'============================<[ Declares ]>============================
Declare Function slAttach lib "SQLitening.Dll" alias "slAttach" (byref rsFileName as String, byref rsAsDatabaseName as String, optional byval rsModChars as String) as Long
Declare Function slBuildBindDat lib "SQLitening.Dll" alias "slBuildBindDat" (byref rsData as String, optional byval rsModChars as String) as String
Declare Function slBuildInsertOrUpdate lib "SQLitening.Dll" alias "slBuildInsertOrUpdate" (byref rsTable as String, byref rsValues as String, optional byval rsColumns as String, optional byval rsWhere as String) as String
Declare Sub      slClose lib "SQLitening.Dll" alias "slClose"
Declare Sub      slCloseSet lib "SQLitening.Dll" alias "slCloseSet" (optional byval rlSetNumber as Long)
Declare Function slConnect lib "SQLitening.Dll" alias "slConnect" (optional byval rsServer as String, optional byval rlPort as Long, optional byval rsModChars as String, optional wsOutData as String)as Long
Declare Function slConvertDat lib "SQLitening.Dll" alias "slConvertDat" (rsData as String, optional byval rsModChars as String) as String
Declare Function slCopyDatabase lib "SQLitening.Dll" alias "slCopyDatabase" (rsDestinationFileName as String, optional byval rsModChars as String, optional byval rsDatabaseName as String) as Long
Declare Sub      slDisconnect lib "SQLitening.Dll" alias "slDisconnect"
Declare Function slExe lib "SQLitening.Dll" alias "slExe" (byref rsStatement as String, optional byval rsModChars as String) as Long
Declare Function slExeBind lib "SQLitening.Dll" alias "slExeBind" (byref rsStatement as String, byref rsData as String, optional byval rsModChars as String) as Long
Declare Function slF lib "SQLitening.Dll" alias "slF" (byval rlColumnNumber as Long, optional byval rlSetNumber as Long) as String
Declare Function slFN lib "SQLitening.Dll" alias "slFN" (byref rsColumnName as String, optional byval rlSetNumber as Long) as String
Declare Function slFNX lib "SQLitening.Dll" alias "slFNX" (byref rsColumnName as String, optional byval rsModChars as String, optional byval rlSetNumber as Long) as String
Declare Function slFX lib "SQLitening.Dll" alias "slFX" (byval rlColumnNumber as Long, optional byval rsModChars as String, optional byval rlSetNumber as Long) as String
Declare Function slGetChangeCount lib "SQLitening.Dll" alias "slGetChangeCount" (optional byval rsModChars as String) as Long
Declare Function slGetColumnCount lib "SQLitening.Dll" alias "slGetColumnCount" (optional byval rlSetNumber as Long) as Long
Declare Function slGetColumnName lib "SQLitening.Dll" alias "slGetColumnName" (optional byval rlColumnNumber as Long, optional byval rlSetNumber as Long) as String
Declare Function slGetColumnNumber lib "SQLitening.Dll" alias "slGetColumnNumber" (byref rsColumnName as String, optional byval rlSetNumber as Long) as Long
Declare Function slGetError lib "SQLitening.Dll" alias "slGetError" () as String
Declare Function slGetErrorNumber lib "SQLitening.Dll" alias "slGetErrorNumber" () as Long
Declare Function slGetFile lib "SQLitening.Dll" alias "slGetFile" (byref rsFileName as String, byref wsFileData as String, optional byval rsModChars as String) as Long
Declare Function slGetHandle lib "SQLitening.Dll" alias "slGetHandle" (optional byval rsModChars as String, optional byval rlSetNumber as Long) as Dword
Declare Function slGetInsertID lib "SQLitening.Dll" alias "slGetInsertID" () as Quad
Declare Function slGetRow lib "SQLitening.Dll" alias "slGetRow" (optional byval rlSetNumber as Long, optional byval rsModChars as String) as Long
Declare Function slGetStatus lib "SQLitening.Dll" alias "slGetStatus" (byval rlRequest as Long) as String
Declare Function slGetTableColumnNames lib "SQLitening.Dll" alias "slGetTableColumnNames" (byref rsTable as String) as String
Declare Function slGetTableNames lib "SQLitening.Dll" alias "slGetTableNames" (optional byval rsDataBase as String) as String
Declare Function slGetUnusedSetNumber lib "SQLitening.Dll" alias "slGetUnusedSetNumber" as Long
Declare Function slIsColumnNameValid lib "SQLitening.Dll" alias "slIsColumnNameValid" (byref rsColumnName as String, optional byval rlSetNumber as Long) as Long
Declare Function slIsColumnNumberValid lib "SQLitening.Dll" alias "slIsColumnNumberValid" (byval rlColumnNumber as Long, optional byval rlSetNumber as Long) as Long
Declare Function slIsFieldNull lib "SQLitening.Dll" alias "slIsFieldNull" (byval rlColumnNumber as Long, optional byval rlSetNumber as Long) as Long
Declare Function slIsOpen lib "SQLitening.Dll" alias "slIsOpen" () as Long
Declare Function slIsSetNumberValid lib "SQLitening.Dll" alias "slIsSetNumberValid"(optional byval rlSetNumber as Long) as Long
Declare Function slOpen lib "SQLitening.Dll" alias "slOpen" (optional byval rsFileName as String, optional byval rsModChars as String) as Long
Declare Sub      slPopDatabase lib "SQLitening.Dll" alias "slPopDatabase" (optional rsSave as String)
Declare Sub      slPopSet lib "SQLitening.Dll" alias "slPopSet" (optional byval rlSetNumber as Long, optional rsSave as String)
Declare Sub      slPushDatabase lib "SQLitening.Dll" alias "slPushDatabase" (optional wsSave as String)
Declare Sub      slPushSet lib "SQLitening.Dll" alias "slPushSet" (optional byval rlSetNumber as Long, optional wsSave as String)
Declare Function slPutFile lib "SQLitening.Dll" alias "slPutFile" (byref rsFileName as String, byref rsFileData as String, optional byval rsModChars as String) as Long
Declare Function slRunProc lib "SQLitening.Dll" alias "slRunProc" (rsProcName as String, blParm1 as Long, blParm2 as Long, bsParm3 as String, bsParm4 as String, optional byval rsModChars as String) as Long
Declare Function slSel lib "SQLitening.Dll" alias "slSel" (byref rsStatement as String, optional byval rlSetNumber as Long, optional byval rsModChars as String) as Long
Declare Function slSelAry lib "SQLitening.Dll" alias "slSelAry" (byref rsStatement as String, byref wsaColsAndRows() as String, optional byval rsModChars as String) as Long
Declare Function slSelStr lib "SQLitening.Dll" alias "slSelStr" (byref rsStatement as String, optional byval rsModChars as String) as String
Declare Sub      slSetProcessMods lib "SQLitening.Dll" alias "slSetProcessMods" (byref rsModChars as String)
Declare Function slSetRelNamedLocks lib "SQLitening.Dll" alias "slSetRelNamedLocks"(byref rsLockNames as String, optional byval rsModChars as String, _
                                                                                    optional byval rsSelStatement as String, optional byval rsSelSetNumber as Long, optional byval rlSelModChars as String) as Long
